package es.udc.fbellas.j2ee.tiendaweb.http.view.actionforms;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;
import org.apache.struts.action.ActionMessages;

import es.udc.fbellas.j2ee.tiendaweb.model.productofacade.TO.ProductoChunkTO;
import es.udc.fbellas.j2ee.tiendaweb.model.productofacade.delegate.ProductoFacadeDelegateFactory;
import es.udc.fbellas.j2ee.util.exceptions.InstanceNotFoundException;
import es.udc.fbellas.j2ee.util.exceptions.InternalErrorException;
import es.udc.fbellas.j2ee.util.struts.action.DefaultActionForm;

public class FindProductForm extends DefaultActionForm {

    public final static String PRODUCT_IDENTIFIER = "PROD_ID";
    //public final static String USER_IDENTIFIER = "USR_ID";
    
    //private final static Collection IDENTIFIER_TYPES = Arrays.asList(
    //    new String[] {PRODUCT_IDENTIFIER, USER_IDENTIFIER});

    private int identifier;
    private int startIndex;
    private int count;
    private String nameProduct;
    private int idCategory;
    
    public int getIdCategory() {
		return idCategory;
	}

	public void setIdCategory(int idCategory) {
		this.idCategory = idCategory;
	}

	public int getCount() {
		return count;
	}

	public void setCount(int count) {
		this.count = count;
	}

	public int getIdentifier() {
		return identifier;
	}

	public void setIdentifier(int identifier) {
		this.identifier = identifier;
	}

	public String getNameProduct() {
		return nameProduct;
	}

	public void setNameProduct(String nameProduct) {
		this.nameProduct = nameProduct;
	}

	public int getStartIndex() {
		return startIndex;
	}

	public void setStartIndex(int startIndex) {
		this.startIndex = startIndex;
	}

	public FindProductForm() {
        reset();
    }
    
    public void reset(ActionMapping mapping, HttpServletRequest request) {
        reset();
    }
//    
//    public ActionErrors validate(ActionMapping mapping,
//        HttpServletRequest request) {
//        
//        ActionErrors errors = new ActionErrors();
//
//        identifierAsLong = new Long(PropertyValidator.validateLong(
//            errors, "identifier", identifier, true, 0, Long.MAX_VALUE));
//        PropertyValidator.validateString(errors, "identifierType", 
//            identifierType, true, IDENTIFIER_TYPES);
//        
//        return errors;
//        
//    }

    private void reset() {
        identifier = 0;
        startIndex = 1;
        count = 10;
    }
    
}
